package com.ccp.dev.qbdms.controller.testhttpclient;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ccp.dev.qbdms.consts.ZhiLiangConst;
import com.ccp.dev.qbdms.model.WQbdFlightJc;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassDescribe:
 *
 * @author :milihao
 * @date :2019-04-23 Since:1
 */
@RestController()
@RequestMapping("/wQbdFlightJc/"+ ZhiLiangConst.URL_API+ZhiLiangConst.URL_VERSION)
public class HttpClientController {

	@PostMapping("addModel")
	public String test(@RequestBody String param) {
		WQbdFlightJc wQbdFlightJc = JSONObject
						.parseObject(JSONObject.parseObject(param).getString("param"),
								WQbdFlightJc.class);
		return JSON.toJSONString(wQbdFlightJc);
	}

	@PostMapping("updateStatus")
	public String update(@RequestBody String param) {
		WQbdFlightJc wQbdFlightJc = JSONObject
						.parseObject(JSONObject.parseObject(param).getString("param"),
								WQbdFlightJc.class);
		return JSON.toJSONString(wQbdFlightJc);
	}
}
